package com.shengzai.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;


public class HdfsDownload {
    public static void main(String[] args) throws IOException {
        Configuration entries = new Configuration();
        entries.set("fs.defaultFS","hdfs://master:9000");
        FileSystem fileSystem = FileSystem.get(entries);

        fileSystem.copyToLocalFile(new Path("/input/b.txt"),new Path("hadoop_code/src/data"));
        fileSystem.close();
    }
}
